#!/bin/bash

brew install --no-quarantine vscodium
defaults write com.vscodium ApplePressAndHoldEnabled -bool false
sudo python3 -c "$(curl -fsSL https://gitee.com/hevey88/install_script/raw/main/vscode_markdown.py)" &

codium --install-extension formulahendry.code-runner &
codium --install-extension donjayamanne.githistory &
codium --install-extension mhutchie.git-graph &
codium --install-extension asvetliakov.vscode-neovim &
codium --install-extension esbenp.prettier-vscode &
codium --install-extension albert.TabOut &
codium --install-extension wayou.vscode-todo-highlight &
codium --install-extension Gruntfuggly.todo-tree &
codium --install-extension Codeium.codeium &
codium --install-extension christian-kohler.path-intellisense &

(curl -o Kuroxx.lazygitwrapper-1.0.1.vsix -L https://Kuroxx.gallery.vsassets.io/_apis/public/gallery/publisher/Kuroxx/extension/lazygitwrapper/1.0.1/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage &&
	codium --install-extension Kuroxx.lazygitwrapper-1.0.1.vsix && rm -rf Kuroxx.lazygitwrapper-1.0.1.vsix) &

# python
# codium --install-extension ms-python.python &
# only for formatter
codium --install-extension charliermarsh.ruff &
codium --install-extension ms-python.isort &
codium --install-extension KevinRose.vsc-python-indent &

# python lsp

(curl -o ms-python.vscode-pylance-2024.4.1.vsix -L https://ms-python.gallery.vsassets.io/_apis/public/gallery/publisher/ms-python/extension/vscode-pylance/2024.4.1/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage &&
	codium --install-extension ms-python.vscode-pylance-2024.4.1.vsix && rm -rf ms-python.vscode-pylance-2024.4.1.vsix &&
	perl -i -pe 's/if\(!_0x19.*?disposables.*?};//' ~/.vscode-oss/extensions/ms-python.vscode-pylance-2024.4.1/dist/extension.bundle.js) &

# (codium --install-extension pylance-2024.4.1.vsix && perl -i -pe 's/if\(!_0x19.*?disposables.*?};//' ~/.vscode-oss/extensions/ms-python.vscode-pylance-2024.4.1/dist/extension.bundle.js) &

# c
codium --install-extension llvm-vs-code-extensions.vscode-clangd &

# lua
(curl -o Kampfkarren.selene-vscode-1.5.1.vsix -L https://Kampfkarren.gallery.vsassets.io/_apis/public/gallery/publisher/Kampfkarren/extension/selene-vscode/1.5.1/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage &&
	codium --install-extension Kampfkarren.selene-vscode-1.5.1.vsix && rm -rf Kampfkarren.selene-vscode-1.5.1.vsix &&
	perl -i -0777pe 's/return\ getLatestSeleneRelease\(\)[^;]*?;[^;]*?;[^;]*?;//' ~/.vscode-oss/extensions/kampfkarren.selene-vscode-1.5.1/out/util.js) &

codium --install-extension sumneko.lua &
codium --install-extension JohnnyMorganz.stylua &

# bash
codium --install-extension mads-hartmann.bash-ide-vscode &
# formattar
codium --install-extension mkhl.shfmt &
